package com.uyaer.card.battle.el
{
	import com.uyaer.card.common.Common;
	import com.uyaer.card.vo.soilder.SoilderVo;
	
	import flash.display.Sprite;
	
	public class Blood extends Sprite
	{
		public var vo:SoilderVo;
		public function Blood(vo:SoilderVo)
		{
			this.vo = vo;
			
			update();
		}
		
		private function update():void{
			graphics.clear();
			graphics.lineStyle(1);
			graphics.drawRect(0,0,80*Common.S,20*Common.S);
			if(vo.isMyself){
				graphics.beginFill(0x00ff00);
			}else{
				graphics.beginFill(0xff0000);
			}
			graphics.drawRect(1,1,78*Common.S*Math.min(vo.hp/vo.maxHp,1)-2,18*Common.S-2);
			graphics.endFill();
		}
	}
}